import java.util.Scanner;

public class InitCalcu {
    public static void main(String[] args) {
        Calculator calculator=new Calculator();
        Scanner in=new Scanner(System.in);
        double result=0.0;
        System.out.println("请输入第一个操作数:");
        calculator.num1=in.nextDouble();
        System.out.println("请输入运算符(+、-、*、/):");
        char ch=in.next().charAt(0);
        System.out.println("请输入第一个操作数:");
        calculator.num2=in.nextDouble();
        switch (ch){
            case '+':
                result=calculator.plus(calculator.num1,calculator.num2);
                break;
            case '-':
                result=calculator.minus(calculator.num1,calculator.num2);
                break;
            case '*':
                result=calculator.multiplyBy(calculator.num1,calculator.num2);
                break;
            case '/':
                result=calculator.divide(calculator.num1,calculator.num2);
                break;
                default:
                    System.out.println("你输入的运算符不正确!");
        }
        System.out.println(calculator.num1+ch+calculator.num1+"="+result);
    }
}
